import React from "react";
import {inject, observer} from 'mobx-react';
import FollowList from "../../../workflowpublic/components/follow/index";
import FollowListStore from "../../../workflowpublic/stores/FollowListStore";
import Loading from "../secondauth/AsyncLoading";

@observer
export default class Main extends React.Component {
    constructor(props) {
        super(props);
        this.state = {store: null};
    }

    componentDidMount() {
        this.setState({
            store: new FollowListStore()
        });
    }

    // //验证成功后的回调方法
    // onAuthSuccess(result) {
    //     const {secondAuthStore} = this.props;
    //     secondAuthStore.controlDialogVisible(authTypes.SECOND_AUTH_DIALOG, false);       //关闭窗口

    //     const {callbackFunc, callbackParam} = secondAuthStore;
    //     const {isProtectDialog} = result;

    //     if (isProtectDialog == 1) {
    //         secondAuthStore.setDialogResult({isProtectSuccess: 1});  //数据保护成功
    //     } else if (isProtectDialog == 10) {
    //         secondAuthStore.setDialogResult({isProtectSuccess: 1});  //数据保护成功
    //         secondAuthStore.setDialogResult({isAuthSuccess: 1});  //二次验证成功
    //     } else {
    //         secondAuthStore.setDialogResult({isAuthSuccess: 1});  //二次验证成功
    //     }

    //     if (callbackFunc && typeof callbackFunc == "function") {
    //         callbackFunc.call({}, callbackParam);    //调用提交流程的方法
    //     }
    // }

    // //验证失败后的回调方法
    // onAuthFail() {
    //     //nothing to do
    // }

    // //关闭窗口
    // onClose() {
    //     const {secondAuthStore} = this.props;
    //     secondAuthStore.controlDialogVisible(authTypes.SECOND_AUTH_DIALOG, false);
    // }

    render() {
        const {store} = this.state;



        if (!!store) {
            return (
                <FollowList
                    visible={true}
                    followListStore={store}/>
            );
        } else {
            return <Loading/>;
        }
    }
}
